<?php

namespace App\Models;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    protected $primaryKey='user_id';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */

    public static function register(array $attribute)
    {
        $user = static::create($attribute);
        return $user;
    }



    protected $fillable = [
        'name', 'email', 'password','phone','sex','avatar','nickname','user_intergral','token','share_time'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token','token','avatar'
    ];

    public function my_avatar()
    {
        return $this->hasOne('App\Models\Pictures','pic_id','avatar');
    }




}
